From aabc6d387e447b1e2b39647b100c1ec2c5c1f240 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 14 Oct 2004 01:49:46 +0000 Subject: [PATCH] Let alt be a float for benefit of D108 and D109 protocols to make more immunune from rounding resulting from integer truncation. (Why do I sense 'm going to regret doing this so late in the release cycle?) --- gpsbabel/jeeps/gps.h | 2 +- gpsbabel/jeeps/gpsapp.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gpsbabel/jeeps/gps.h b/gpsbabel/jeeps/gps.h index 8abd464db..2c6f0c196 100644 --- a/gpsbabel/jeeps/gps.h +++ b/gpsbabel/jeeps/gps.h @@ -129,7 +129,7 @@ typedef struct GPS_SWay int32 colour; char cc[2]; UC wpt_class; - int32 alt; + float alt; char city[24]; char state[2]; char name[30]; diff --git a/gpsbabel/jeeps/gpsapp.c b/gpsbabel/jeeps/gpsapp.c index 5f20f1641..2db5a4df8 100644 --- a/gpsbabel/jeeps/gpsapp.c +++ b/gpsbabel/jeeps/gpsapp.c @@ -1206,7 +1206,7 @@ static void GPS_D108_Get(GPS_PWay *way, UC *s) (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p)); p+=sizeof(int32); - (*way)->alt = (int32)GPS_Util_Get_Float(p); + (*way)->alt = GPS_Util_Get_Float(p); p+=sizeof(float); (*way)->dpth = (int32)GPS_Util_Get_Float(p); p+=sizeof(float); @@ -1270,7 +1270,7 @@ static void GPS_D109_Get(GPS_PWay *way, UC *s) (*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p)); p+=sizeof(int32); - (*way)->alt = (int32)GPS_Util_Get_Float(p); + (*way)->alt = GPS_Util_Get_Float(p); p+=sizeof(float); (*way)->dpth = (int32)GPS_Util_Get_Float(p); p+=sizeof(float); @@ -1953,7 +1953,6 @@ static void GPS_D109_Send(UC *data, GPS_PWay way, int32 *len) p+=sizeof(int32); GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon)); p+=sizeof(int32); - GPS_Util_Put_Float(p,way->alt); p+=sizeof(float); GPS_Util_Put_Float(p,way->dpth); -- 2.30.2